/* RADataChange.java
 *
 * Project/Product: GWBS2009
 *
 * Modify Information:
 * =============================================================================
 *   Author	Date       Description
 *   ----------	---------- ---------------------------------------------------
 *   Arrow	2009-6-29	First release
 *
 * Licensed Materials - Property of APEP
 * =============================================================================
 *    (C) COPYRIGHT Shanghai Auto Mart E-Procurement Co., Ltd. 2007 - 2009
 *    All Rights Reserved.
 *
 *    This software is the confidential and proprietary information of
 *    Shanghai Auto Mart E-Procurement Co., Ltd. ("Confidential Information").
 *    You shall not disclose such Confidential Information and shall use it only
 *    in accordance with the terms of the license agreement you entered into 
 *    with Shanghai Auto Mart E-Procurement Co., Ltd.
 *
 * Noties:
 * =============================================================================
 * 
 */

package client;

import java.util.Map;

public class RADataChange {
    
    public static String changeCategory(String categoryCode){
        String ret = "";
        
        try{
            Map category = RADataMap.getInstance().getCategory();
            ret = (String)category.get(categoryCode);
        }
        catch (Exception e) {
            ret = "";
        }
        
        if(ret == null) ret = categoryCode;
            else if("".equals(ret)) ret = categoryCode; 
        
        return ret;
    }
    
    public static String changeWarehouse(String warehouseCode){
        String ret = "";
        
        try{
            Map warehouse = RADataMap.getInstance().getWarehouseCode();
            ret = (String)warehouse.get(warehouseCode);
        }
        catch(Exception e){
            ret = "";
        }
        
        if(ret == null) ret = warehouseCode;
            else if("".equals(ret)) ret = warehouseCode;
        
        return ret;
    }
    
}
